import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Main from '../views/Main.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		redirect: '/login'
	},
	{
		path: '/login',
		name: 'login',
		component: Login
	},
	{
		path: '/main',
		name: 'main',
		component: Main,
		children: [{
				path: '/',
				redirect: '/home',
			},
			{
				path: '/home',
				component: () => import('../views/Home.vue')
			},
			{
				path: '/xiaoqu',
				component: () => import('../views/Xiaoqu.vue')
			},
			{
				path: '/store',
				component: () => import('../views/Store.vue')
			},
			{
				path: '/post',
				component: () => import('../views/Post.vue')
			},
			{
				path: '/shangpin',
				component: () => import('../views/Shangpin.vue')
			}
		]
	},
]

const router = new VueRouter({
	routes
})

export default router